<template>
	<view class="container">
		<u-sticky offset-top="0">
			<navBarView title="富文本内容" :statusBarHeight="statusBarHeight"></navBarView>
		</u-sticky>
		<view class="whiteView">
			<!-- <text>{{noticeTitle}}</text> -->
			
			<u-parse :content="noticeContent" ></u-parse>
		</view>
	</view>
</template>

<script>

	export default {
		
		onShow() {
			let sysInfo = uni.getSystemInfoSync()
			this.statusBarHeight = sysInfo.statusBarHeight; // 状态栏高度
			this.criminalTypeViewTopHeight = 88+15; // case tyep 距离顶部高度
		},
		data() {
			return {
				statusBarHeight: '',// 状态栏高度 
				
				noticeContent:'<p>露从今夜白，月是故乡明。</p><p>露从今夜白，月是故乡明。</p><p>露从今夜白，月是故乡明。</p><p>露从今夜白，月是故乡明。</p><p>露从今夜白，月是故乡明。</p><p>露从今夜白，月是故乡明。</p>'
			}
		},
		onLoad(option) {
			uni.setNavigationBarTitle({
				title: option.index==1?'用户服务协议':option.index==2?'隐私政策':'法律声明'
			})
			// this.getData(option.index)
		},
		methods: {
			async getData(index){
				let param = {
					'url':index==1?'/api/index/user_agreement':index==2?'api/index/privacy_policy':'api/index/legal_notice',
					'data':{},
					'method':'POST'
				}
				this.$myRequest(param).then(res=>{
					console.log(res)
					if (res.code==1) {
						this.noticeContent = res.data
					}
					else{
						uni.showToast({
							title:res.msg
						})
					}
				})
			},
		}
	}
</script>


<style lang="scss">
.container{
	// padding: 30rpx;
	// background-color: #F5F5F5;
	.whiteView{
		padding: 30rpx;
		background-color: white;
		border-radius:16rpx 16rpx 16rpx 16rpx;
		display: flex;
		flex-direction: column;
		text{
			padding-bottom: 48rpx;
			width: 690rpx;
			color: #333333;
			font-size: 34rpx;
			text-align: center;
		}
	}
}
</style>